-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bril2json -p -p and Rust/Clap updates #233
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This all looks great!!
This is probably for a subsequent PR, but maybe we should just make the enhanced positions thing the default everywhere… that is, we could make the Python-based parser behave the same way, and alleviate the need for the -p -p
mode in the Rust-based parser. Does that seem reasonable to you?
err(`multiply defined label .${instr.label}`, instr.pos); | ||
} else { | ||
labels.add(instr.label); | ||
if (func.instrs){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Seems reasonable to me. A separate question, maybe source positions should be spans by default(instead of starting positions by default) if all of the tools that support source positions provide starting and ending positions. This would mean making the |
Yeah, seems absolutely reasonable to me. |
undefined
) which triggered ontest/check/badcall.bril
for@nothing
. Not sure why this wasn't caught before.-p
flags where just one-p
is still compatible with python versions and-p -p
additionally adds the end source positions.proc_macro2::Span
(best effort) and also adds the--file/-f
flag.I've manually tested the additional support for richer source positions but like the rest of the error-handling support is not rigorously tested.